<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>TODO supply a title</title>
        <style type="text/css">
            
        </style>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script type="text/javascript" src="jquery/jquery-1.8.3.js"></script>
        <script type="text/javascript">
            $(function(){
                //点击之后 动画显示出来
                /*
                
                $("#imgElement img").click(function() {
                    if($(this).attr("src")=="img/images1.jpg") {
                            $(this). attr("src","img/images2.jpg")
                                    .css("opacity",0.0)
                                    .animate({
                                        opacity:1.0
                           });
                    }else {
                            $(this). attr("src","img/images1.jpg")
                                    .css("opacity",0.0)
                                    .animate({
                                        opacity:1.0
                           });
                    }
                });
                */
                function change() {
                    var ele = $("#imgElement img");
                    if(ele.attr("src")=="img/images1.jpg") {
                            ele. attr("src","img/images2.jpg")
                                    .css("opacity",0.0)
                                    .animate({
                                        opacity:1.0
                           },1000);
                    }else {
                            ele. attr("src","img/images1.jpg")
                                    .css("opacity",0.0)
                                    .animate({
                                        opacity:1.0
                           },1000);
                    }
                }
                setInterval(change, 3000);
            });
            
        </script>
    </head>
    <body>
        <div id="imgElement">
            <img src="img/images1.jpg" alt="测试"/>
        </div>
    </body>
</html>
